﻿@{
    ViewBag.Title = "登录日志";
    Layout = "~/Areas/Backend/Views/Shared/_List.cshtml";
}

@section crumbs{
    <label class="backend-crumbs-separator">/</label>
    <a href="#" title="数据管理">数据管理</a>
    <label class="backend-crumbs-separator">/</label>
    <a href="#" title="日志管理">日志管理</a>
    <label class="backend-crumbs-separator">/</label>
    <a href="#" title="登录日志">登录日志</a>
    <label class="backend-crumbs-separator">/</label>
    <a href="#" title="日志列表">日志列表</a>
}

@section buttons{
    <span class="list-btn" onclick="backend.checkall(this);"><i class="monk-iconfont icon-backend-quanxuan"></i><label>全选</label></span>
    <span class="list-btn" onclick="detail();"><i class="monk-iconfont icon-backend-details"></i><label>查看</label></span>
    <span class="list-btn"><i class="monk-iconfont icon-backend-delete"></i><label>删除</label></span>
    <span class="list-btn float-right"><i class="monk-iconfont icon-backend-search-list"></i><label>搜索</label></span>
}

<div class="monk-table">
    <table>
        <thead>
            <tr>
                <th align="center">
                    选择
                </th>
                <th align="left" width="10%">
                    账号
                </th>
                <th align="left" width="12%">
                    密码
                </th>
                <th align="left">
                    登入时间
                </th>
                <th align="left">
                    退出时间
                </th>
                <th align="left" width="10%">
                    登录IP
                </th>
                <th align="center" class="monk-table-status">
                    成功
                </th>
                <th align="center" class="monk-table-status">
                    异步
                </th>
                <th align="center" class="monk-table-status">
                    移动设备
                </th>
            </tr>
        </thead>
        <tbody></tbody>
        <tfoot>
        </tfoot>
    </table>
</div>

@section operate{
    <div id="page" class="m-pagination"></div>
}

@section foot{
    <script type="text/javascript">
        function detail(){
            var ids=backend.getCheckIds();
            if(ids.length==1){
                window.location.href="@Url.Action("Detail","LoginLog",new { })/"+ids[0];
            }
            else{
                backend.Tip("至多至少必须选择一条进行操作");
            }
        }
    </script>
    <script type="text/html" id="tpl">
        <% for(var i=0;i < data.length;i++){ %>
        <tr>
            <td class="monk-td-radio">
                <span class="monk-iconfont icon-backend-checkbox list-radio" data-id="<%=data[i].LogID%>"></span>
            </td>
            <td>
                <%=data[i].Account %>
            </td>
            <td>
                <%=data[i].Password %>
            </td>
            <td>
                <%=backend.datetimeFormat(data[i].InTime) %>
            </td>
            <td>
                <%=backend.datetimeFormat(data[i].OffTime) %>
            </td>
            <td>
                <%=data[i].IPAddress %>
            </td>
            <td class="monk-table-status">
                <%=backend.setStatus(data[i].Sucessed) %>
            </td>
            <td class="monk-table-status">
                <%=backend.setStatus(data[i].AjaxRequest) %>
            </td>
            <td class="monk-table-status">
                <%=backend.setStatus(data[i].MobileDevice) %>
            </td>
        </tr>
        <% } %>
    </script>
    <script type="text/javascript">
        $(function () {
            var render= monk.tppl(document.getElementById("tpl").innerHTML);
            backend.pagination("@Url.Action("List","LoginLog")",@ViewBag.SysSetInfo.PageSize,{},function(data){
                var html=  render(data);
                $(".monk-table table tbody").html(html);
            });
        });
    </script>
}
